﻿<!DOCTYPE html>

<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="~/Content/css/framework-font.css" rel="stylesheet" />
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <script src="~/Content/js/jquery/jquery-2.1.1.min.js"></script>
    <script src="~/Content/js/jquery-ui/jquery-ui.min.js"></script>
    <script src="~/Content/js/bootstrap/bootstrap.js"></script>
    <link href="~/Content/js/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="~/Content/js/layout/jquery.layout.js"></script>
    <script src="~/Content/js/wdtree/tree.js"></script>
    <link href="~/Content/js/wdtree/tree.css" rel="stylesheet" />
    <script src="~/Content/js/jqgrid/jqgrid.min.js"></script>
    <link href="~/Content/js/jqgrid/jqgrid.css" rel="stylesheet" />
    <script src="~/Content/js/jqgrid/grid.locale-cn.js"></script>
    <link href="~/Content/css/framework-ui.css" rel="stylesheet" />
    <script src="~/Content/js/framework-ui.js"></script>

    <style>
        html, body {
            height: 100%;
            width: 100%;
        }
    </style>
</head>
<body>
    <div id="container" class="container">
        <table class="table table-bordered table-condensed">
            <thead>
                <tr>
                    <th>文件名</th>
                </tr>
            </thead>
            <tbody id="filePanel"></tbody>
        </table>
    </div>

    <script>
        $(function () {

            $.ajax({
                url: "GetFileJson",
                data: {},
                dataType: "json",
                async: false,
                success: function (data) {
                    console.log(data);
                    var html = '';
                    if (data && data.files.length) {
                        for (var i = 0; i < data.files.length; i++) {
                            var item = data.files[i];
                            html += '<tr>';
                            html += '<td>';
                            html += '<a href="' + item.Item2 +'">'+ item.Item1+'</a>';
                            html += '</td>';
                            html += '</tr>';
                        }
                    }
                    $("#filePanel").html(html);
                }
            });

        });
    </script>
</body>
</html>
